﻿<Fluent:RibbonWindow x:Class="WPFExcelReport.MainWindow"
                     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                     xmlns:Fluent="clr-namespace:Fluent;assembly=Fluent"
                     xmlns:ad="clr-namespace:AvalonDock;assembly=AvalonDock" 
                     xmlns:UserControls="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Controls"
                     xmlns:converters="clr-namespace:ReflectionStudio.Components.Converters;assembly=ReflectionStudio.Controls"
                     ResizeMode="CanResizeWithGrip" Title="{Binding Title}" Height="800" Width="1200"
                     Closing="OfficeWindow_Closing" Drop="OfficeWindow_Drop"
                     Background="{DynamicResource WindowBackgroundBrush}"
                     FontSize="14"
                     WindowState="Maximized">
<Fluent:RibbonWindow.Resources>
        <DataTemplate x:Key="ThemeItemTemplate">
            <Border ToolTip="{Binding Name}">
                <StackPanel Orientation="Vertical">
                    <Image Source="{Binding Image}" Stretch="None"/>
                    <TextBlock Text="{Binding Path=Name, Mode=OneWay}" FontSize="14" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                </StackPanel>
            </Border>
        </DataTemplate>
    </Fluent:RibbonWindow.Resources>
    <Grid  Name="MainGrid">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

        <!--#################################################################################################-->
        <!--RIBBON CONTROL-->
        <Fluent:Ribbon Grid.Row="0" HorizontalAlignment="Stretch" Name="ribbonMain" AutomaticStateManagement="True" FontSize="14"
                       Title="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}},Path=Title}" >

            <!--#################################################################################################-->
            <!--Backstage Items-->
            <Fluent:Ribbon.Menu >
                <Fluent:Backstage IsEnabled="True" Visibility="Visible"  Name="bkMain"  Background="Green" Header="文件">
                    <Fluent:BackstageTabControl>
                        <Fluent:Button Header="刷新菜单"  IsEnabled="True" Visibility="Visible"   Tag="ITXSETUP" 
                                         Click="btnReport_Click"
                                       SizeDefinition="Small"
                               Icon="Resources\Images\16x16\folders\keys.png"
                               LargeIcon="Resources\Images\32x32\folders\keys.png" />
                        <Fluent:Button Header="重置功能表"  IsEnabled="True" Visibility="Visible"  Name="btnUserSetUp"
                                       Click="btnUserSetUp_Click"
                                       SizeDefinition="Small"
                               Icon="Resources\Images\16x16\folders\keys.png"
                               LargeIcon="Resources\Images\32x32\folders\keys.png" />
                        <Fluent:Button Header="接口定义"   Tag="CADMAPINTEX"  IsEnabled="True" Visibility="Visible"  Name="btnInterface"
                                       Click="btnReport_Click"
                                       SizeDefinition="Small"
                               Icon="Resources\Images\16x16\folders\keys.png"
                               LargeIcon="Resources\Images\32x32\folders\keys.png" /> 
                            <Fluent:Button Header="检查"  IsEnabled="True" Visibility="Visible"  Name="btnCheUpdate"
                                       Click="btnCheUpdate_Click"
                                       SizeDefinition="Small"
                               Icon="Resources\Images\16x16\folders\keys.png"
                               LargeIcon="Resources\Images\32x32\folders\keys.png" />
                    </Fluent:BackstageTabControl>
                </Fluent:Backstage>
            </Fluent:Ribbon.Menu>
            <!--################   project tab   ################-->
            <Fluent:RibbonTabItem Header="工艺开发" Tag="HomeTech" Name="tabArticle"  >
                <Fluent:RibbonGroupBox Header="生产开发工艺"  Name="gpArticle"
                                        IsEnabled="False" 
                                       IsLauncherVisible="True">
                </Fluent:RibbonGroupBox>
            </Fluent:RibbonTabItem>
            <Fluent:RibbonTabItem Header="单证" Name="gpDoc" >
                <Fluent:RibbonGroupBox Header="生产" Name="gpProd"  >
                      </Fluent:RibbonGroupBox>
                <Fluent:RibbonGroupBox Header="销售" Name="gbSales">
                 
                </Fluent:RibbonGroupBox>
            </Fluent:RibbonTabItem>
            <Fluent:RibbonTabItem Header="销售部" Name="tabSales"  >
                <Fluent:RibbonGroupBox Header="销售部" Name="gpSales"  > 
                </Fluent:RibbonGroupBox>
            </Fluent:RibbonTabItem>
            <Fluent:RibbonTabItem Header="计划部" Name="tabPlan"  >
                <Fluent:RibbonGroupBox Header="计划部" Name="gpPlan"  >
              
                </Fluent:RibbonGroupBox>
                <Fluent:RibbonGroupBox Header="原料供应" Name="gpMaterilaSupply">
                </Fluent:RibbonGroupBox>
                <Fluent:RibbonGroupBox Header="仓库" Name="gpMaterial">
                </Fluent:RibbonGroupBox>
            </Fluent:RibbonTabItem>
            <Fluent:RibbonTabItem Header="统计" Name="tabChart"  >
                <Fluent:RibbonGroupBox Header="成品" Name="gpFinish">
                </Fluent:RibbonGroupBox>
                <Fluent:RibbonGroupBox Header="浆纱" Name="gpSizing"  >
                </Fluent:RibbonGroupBox>
                <Fluent:RibbonGroupBox Header="染纱" Name="gpDye">
                </Fluent:RibbonGroupBox>
                <Fluent:RibbonGroupBox Header="生产" Name="gpProduction">  
                </Fluent:RibbonGroupBox>
                <Fluent:RibbonGroupBox Header="产量" Name="gpOutput">
                </Fluent:RibbonGroupBox>
            </Fluent:RibbonTabItem>
            <Fluent:RibbonTabItem Header="采购部" Name="tabPurchase"  >
                <Fluent:RibbonGroupBox  Header="采购部" Tag="HomeEK" Name="gpEK"  >
                </Fluent:RibbonGroupBox>
            </Fluent:RibbonTabItem>
            <Fluent:RibbonTabItem Header="仓库" Name="tabWarehouse" >
                <Fluent:RibbonGroupBox Header="仓库报表"  Name="gpWarehouse" Tag="HomeWB"  >
                 </Fluent:RibbonGroupBox>
            </Fluent:RibbonTabItem>
            <Fluent:RibbonTabItem Header="质检" Name="tabQuality" >
                <Fluent:RibbonGroupBox Header="坯布" Name="gpWS03"  >
                </Fluent:RibbonGroupBox>
            </Fluent:RibbonTabItem>
            <Fluent:RibbonTabItem Header="综合" Name="tabYingbang" >
                <Fluent:RibbonGroupBox Header="进销存" Name="gPONe">

                </Fluent:RibbonGroupBox>
            </Fluent:RibbonTabItem>
            <Fluent:RibbonTabItem Header="财务" Name="tabFinance" >
                <Fluent:RibbonGroupBox Header="财务报表" Name="gpINOUTINV" >

                </Fluent:RibbonGroupBox>
            </Fluent:RibbonTabItem>
            <Fluent:RibbonTabItem Header="系统设定"  Name="tabSystem">
                <Fluent:RibbonGroupBox Header="系统"  Name="gpSystem" > 
                </Fluent:RibbonGroupBox>
            </Fluent:RibbonTabItem> 
        </Fluent:Ribbon>
        <!--#################################################################################################-->
        <!--CONTENT-->
        <ad:DockingManager Grid.Row="1" x:Name="_dockingManager" Loaded="_dockingManager_Loaded">
            <ad:ResizingPanel Orientation="Vertical">
                <ad:ResizingPanel Orientation="Horizontal">
                    <ad:ResizingPanel Orientation="Vertical" ad:ResizingPanel.ResizeWidth="200">
                    <!--LEFT PART-->
                    <!--ad:DockablePane>
                        <ad:DockableContent Name="menu" >
                            <TreeView Grid.Row="0"  HorizontalAlignment="Stretch" 
                                          Margin="0,0,0,0" Name="treeViewReport" 
                                          VerticalAlignment="Stretch" 
                                          SelectedItemChanged="treeViewReport_SelectedItemChanged">
                                    <TreeViewItem Header="工艺开发" Tag="HomeTech" Name="ttabArticle"  IsEnabled="False" Visibility="Hidden">
                                        <TreeViewItem Header="生产开发工艺"  Name="tgpArticle">
                                        </TreeViewItem>
                                    </TreeViewItem>
                                    <TreeViewItem Header="单证"  Name="tgpDoc"   IsEnabled="False" Visibility="Hidden" >
                                        <TreeViewItem Header="生产"  Name="tgpProd"    IsEnabled="False" Visibility="Hidden">
                                        </TreeViewItem>
                                        <TreeViewItem Header="销售"  Name="tgbSales"   IsEnabled="False" Visibility="Hidden" >
                                        </TreeViewItem>
                                    </TreeViewItem>
                                    <TreeViewItem Header="销售部" Name="ttabSales"  IsEnabled="False" Visibility="Hidden">
                                        <TreeViewItem Header="销售部" Name="tgpSales"  IsEnabled="False" Visibility="Hidden">
                                        </TreeViewItem>
                                        </TreeViewItem>
                                    <TreeViewItem Header="计划部"  Name="ttabPlan"   IsEnabled="False" Visibility="Hidden" >
                                        <TreeViewItem Header="计划部"  Name="tgpPlan"   IsEnabled="False" Visibility="Hidden" >
                                        </TreeViewItem>
                                        <TreeViewItem Header="原料供应"  Name="tgpMaterilaSupply"   IsEnabled="False" Visibility="Hidden" >
                                        </TreeViewItem>
                                        <TreeViewItem Header="仓库"  Name="tgpMaterial"   IsEnabled="False" Visibility="Hidden" >
                                        </TreeViewItem>
                                    </TreeViewItem>
                                    <TreeViewItem Header="统计" Name="ttabChart"  IsEnabled="False" Visibility="Hidden">
                                        <TreeViewItem Header="浆纱" Name="tgpSizing"  IsEnabled="False" Visibility="Hidden">
                                            </TreeViewItem>
                                            <TreeViewItem Header="染纱" Name="tgpDye">
                                            </TreeViewItem>
                                            <TreeViewItem Header="生产" Name="tgpProduction">
                                            </TreeViewItem>
                                            <TreeViewItem Header="产量" Name="tgpOutput">
                                            </TreeViewItem>
                                            </TreeViewItem>
                                    <TreeViewItem Header="采购部" Name="ttabPurchase"  IsEnabled="False" Visibility="Hidden">
                                        <TreeViewItem  Header="采购部" IsEnabled="False" Name="tgpEK" Visibility="Hidden"  >
                                        </TreeViewItem>
                                    </TreeViewItem>
                                    <TreeViewItem Header="仓库" Name="ttabWarehouse"  IsEnabled="False" Visibility="Hidden">
                                        <TreeViewItem Header="仓库报表"  Name="tgpWarehouse" Tag="HomeWB"  IsEnabled="False" Visibility="Hidden">
                                        </TreeViewItem>
                                    </TreeViewItem>
                                    <TreeViewItem Header="质检" Name="ttabQuality"  IsEnabled="False" Visibility="Hidden">
                                        <TreeViewItem Header="坯布" Name="tgpWS03"  IsEnabled="False" Visibility="Hidden">
                                        </TreeViewItem>
                                    </TreeViewItem>
                                    <TreeViewItem Header="英邦" Name="ttabYingbang"  IsEnabled="False" Visibility="Hidden">

                                    </TreeViewItem>
                                    <TreeViewItem Header="财务" Name="ttabFinance"  IsEnabled="False" Visibility="Hidden">
                                        <TreeViewItem Header="进销存" Name="tgpINOUTINV"  IsEnabled="False" Visibility="Hidden">
                                        </TreeViewItem>
                                    </TreeViewItem>
                                    <TreeViewItem Header="系统设定"  IsEnabled="False" Visibility="Hidden" Name="ttabSystem">
                                                         <TreeViewItem Header="系统"  IsEnabled="False" Visibility="Hidden">
                                        </TreeViewItem>
                                    </TreeViewItem>
                                </TreeView>
                        </ad:DockableContent>
                    </ad:DockablePane-->
                    </ad:ResizingPanel>
                    <!--#################################################################################################-->
                    <!--CENTER PART-->
                    <ad:DocumentPane x:Name="_documentsHost">
                    </ad:DocumentPane>        
                </ad:ResizingPanel>
                <ad:ResizingPanel Orientation="Horizontal">
                    <!--#################################################################################################-->
                    <!--LOGS EXPLORER-->
                    <ad:DockablePane>
                        <UserControls:EventLogExplorer x:Name="_LogExplorerDock" />
                    </ad:DockablePane>
                </ad:ResizingPanel>
            </ad:ResizingPanel>
        </ad:DockingManager>

        <!--#################################################################################################-->
        <!--STATUS BAR-->
        <UserControls:StatusBar Grid.Row="2" x:Name="MainStatusBar" />
    </Grid>
</Fluent:RibbonWindow>
